The JPEG attribute in jfif format is read and the standard file header is read. The structure of other content must be parsed one by one. It is not done for the time being. Interested friends can continue to improve it.
Procedure tjfif. readappn;
Sometimes, to hide the truth, we define the file as a header and then download the readfile, but this will increase the burden on the server. Generally, we do not recommend downloading large files.
Sometimes, to hide the truth, we define the file as
Sometimes, to hide the truth, we define the file as a header and then download the readfile, but this will increase the burden on the server. generally, we do not recommend downloading large files.
The code is as follows:
Function sendFile ($
PHP file type verification class function based on the file header. I wrote a verification class here to determine the file format through the file header. (It is not secure. if the user spoofs the file header, it can also pass verification.) copy
I've written a validation class here that uses the file header to determine the file format. (also not completely secure, if the user forged the file header, can also be verified)
Copy CodeThe code is as follows:
/**
* Type of document to be
PHP header send various types of files and settings file download name
Header (' content-type:application/image/pjpeg ');//type of output
Header (' content-disposition:attachment; filename= ' downloaded.jpg '); Download the displayed name,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.